package com.tele.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckRole;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.R;
import com.sun.net.httpserver.Authenticator;
import com.tele.domain.Cpu;
import com.tele.service.ints.CpuService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@SaCheckLogin
@RequiredArgsConstructor
public class CpuController {
    final CpuService cpuService;

    @GetMapping("getAllCpu")
    public List getAllCpu() {
//        Page<Cpu> cpuPage = new Page<>(page,limit);
//        IPage<Cpu> pagemodel = cpuService.selectPage(cpuPage,cpuVo);
        return cpuService.getAllCpu();
    }

//    @SaCheckRole("admin")
//    @GetMapping("cpuDeleteById")
//    public Object deleteCpuById(Long cpuId) {
//        if (cpuId == null) {
//            return R.fail("id为空");
//        }
//        if (cpuService.delCpuById(cpuId) != 1)
//            return R.fail("id不匹配");
//        return R.ok();
//    }
}
